/**
 * Project Name:SysUser.java
 * File Name:SysUser.java
 * Date:2018年06月28日 11:09
 * Copyright (c) 2018, zhang.xiangyu@foxmail.com All Rights Reserved.
 */
package com.dyrj.base.system.user.model;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import com.dyrj.base.system.org.model.TDepartment;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import com.dyrj.base.system.menu.model.SysMenu;
import com.dyrj.base.system.role.model.SysRole;
import com.dyrj.utils.DateUtil;
import com.dyrj.vo.Pagetag;

/**   
 * @Title: SysUser
 * @Description: todo(系统用户)
 * @Author
 * @Date 2018年06月28日 11:09
 */
@Data
public class SysUser extends Pagetag implements Serializable {
    private static final long serialVersionUID = 4178799290198757868L;
    /**
     * 主键
     */
	private Long id;
	private Long creatoraccountid;
	private Long tenantid;
	
    /**
     * 头像
     */
    private String avatar;
    
    /**
     * 账号
     */
    private String account;

    /**
     * 密码
     */
    private String password;

    /**
     * vo 是否重置密码
     */
    private boolean resetPwd = false;

    /**
     * md5密码盐
     */
    private String salt;

    /**
     * 名字
     */
    private String name;

    /**
     * 生日
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date birthday;
    /**
     * vo 生日文字描述
     */
    private String birthdayText;

    /**
     * 性别（1：男 2：女）
     */
    private Integer sex;
    /**
     * vo 性别文字描述
     */
    private String sexName;

    public String getDeptname() {
        return deptname;
    }

    public void setDeptname(String deptname) {
        this.deptname = deptname;
    }

    private String deptname;
    /**
     * 电子邮件
     */
    private String email;

    /**
     * 电话
     */
    private String phone;

    /**
     * 角色id
     */
    private String roleid;

    /**
     * 部门id
     */
    private Long deptid;
    private String deptText;

    public String getDeptText() {
        return deptText;
    }

    public void setDeptText(String deptText) {
        this.deptText = deptText;
    }

    /**
     * 状态(1：启用  0：冻结）
     */
    private Integer status;
    /**
     * vo 状态文字描述
     */
    private String statusName;
    /**
     * vo 状态Boolean类型描述
     */
    private boolean statusType;

    /**
     * 创建时间
     */
    private Date createtime;
    /**
     * vo 时间文字描述
     */
    private String createtimeText;

    /**
     * 保留字段
     */
    private Integer version;

    /**
     * vo 用户验证用户信息
     */
    private String verify;

    /**
     * 是否记住密码
     */
    private boolean rememberMe;

    /**
     * 用户公钥
     */
    private String publicKey;

    /**
     * 平台公钥
     */
    private String platformPublicKey;

    /**
     * APPID
     */
    private String appid;

    /**
     * 调用密码
     */
    private String appsecret;

    /**
     * 调用密码
     */
    private String subno;
    private Integer messgeno;
    private Date accepttime;
    private BigDecimal totalmoney;
    private Integer totalpoint;


    public Integer getMessgeno() {
        return messgeno;
    }

    public void setMessgeno(Integer messgeno) {
        this.messgeno = messgeno;
    }

    public Date getAccepttime() {
        return accepttime;
    }

    public void setAccepttime(Date accepttime) {
        this.accepttime = accepttime;
    }

    public BigDecimal getTotalmoney() {
        return totalmoney;
    }

    public void setTotalmoney(BigDecimal totalmoney) {
        this.totalmoney = totalmoney;
    }

    public Integer getTotalpoint() {
        return totalpoint;
    }

    public void setTotalpoint(Integer totalpoint) {
        this.totalpoint = totalpoint;
    }

    /**
     * vo 角色列表
     */
    private List<SysRole> rolesVo;

//    private List<TTenant> tTenantVo;
    /**
     * vo菜单列表
     */
    private List<SysMenu> menusVo;
    private List<TDepartment> deptVo;
    //vo
    private Boolean checked = Boolean.FALSE;

    public Boolean getChecked() {
        return checked;
    }

    public void setChecked(Boolean checked) {
        this.checked = checked;
    }

    public List<TDepartment> getDeptVo() {
        return deptVo;
    }

    public void setDeptVo(List<TDepartment> deptVo) {
        this.deptVo = deptVo;
    }

    /**
     * vo
     */
    private String loginUser;

    public void setBirthday(Date birthday) {
        this.birthdayText = DateUtil.getDay(birthday);
        this.birthday = birthday;
    }

    public void setSex(Integer sex) {
        if(sex.equals(1)) {
            this.sexName = "男";
        } else if(sex.equals(2)) {
            this.sexName = "女";
        } else {
            this.sexName = "保密";
        }
        this.sex = sex;
    }

    public void setStatus(Integer status) {
        if(status.equals(1)) {
            this.statusName = "启用";
        } else {
            this.statusName = "冻结";
        }
        this.status = status;
    }

    public void setStatusType(boolean statusType) {
        if(statusType) {
            this.status = 1;
        } else {
            this.status = 0;
        }
        this.statusType = statusType;
    }

    public void setCreatetime(Date createtime) {
        this.createtimeText = DateUtil.getTime(createtime);
        this.createtime = createtime;
    }

    public Long getTenantid() {
        return tenantid;
    }

    public void setTenantid(Long tenantid) {
        this.tenantid = tenantid;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public boolean isResetPwd() {
        return resetPwd;
    }

    public void setResetPwd(boolean resetPwd) {
        this.resetPwd = resetPwd;
    }

    public String getSalt() {
        return salt;
    }

    public void setSalt(String salt) {
        this.salt = salt;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Date getBirthday() {
        return birthday;
    }

    public String getBirthdayText() {
        return birthdayText;
    }

    public void setBirthdayText(String birthdayText) {
        this.birthdayText = birthdayText;
    }

    public Integer getSex() {
        return sex;
    }

    public String getSexName() {
        return sexName;
    }

    public void setSexName(String sexName) {
        this.sexName = sexName;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getRoleid() {
        return roleid;
    }

    public void setRoleid(String roleid) {
        this.roleid = roleid;
    }

    public Long getDeptid() {
        return deptid;
    }

    public void setDeptid(Long deptid) {
        this.deptid = deptid;
    }

    public Integer getStatus() {
        return status;
    }

    public String getStatusName() {
        return statusName;
    }

    public void setStatusName(String statusName) {
        this.statusName = statusName;
    }

    public boolean isStatusType() {
        return statusType;
    }

    public Date getCreatetime() {
        return createtime;
    }

    public String getCreatetimeText() {
        return createtimeText;
    }

    public void setCreatetimeText(String createtimeText) {
        this.createtimeText = createtimeText;
    }

    public Integer getVersion() {
        return version;
    }

    public void setVersion(Integer version) {
        this.version = version;
    }

    public String getVerify() {
        return verify;
    }

    public void setVerify(String verify) {
        this.verify = verify;
    }

    public boolean isRememberMe() {
        return rememberMe;
    }

    public void setRememberMe(boolean rememberMe) {
        this.rememberMe = rememberMe;
    }

    public String getPublicKey() {
        return publicKey;
    }

    public void setPublicKey(String publicKey) {
        this.publicKey = publicKey;
    }

    public String getPlatformPublicKey() {
        return platformPublicKey;
    }

    public void setPlatformPublicKey(String platformPublicKey) {
        this.platformPublicKey = platformPublicKey;
    }

    public String getAppid() {
        return appid;
    }

    public void setAppid(String appid) {
        this.appid = appid;
    }

    public String getAppsecret() {
        return appsecret;
    }

    public void setAppsecret(String appsecret) {
        this.appsecret = appsecret;
    }

    public List<SysRole> getRolesVo() {
        return rolesVo;
    }

    public void setRolesVo(List<SysRole> rolesVo) {
        this.rolesVo = rolesVo;
    }

    public List<SysMenu> getMenusVo() {
        return menusVo;
    }

//    public List<TTenant> gettTenantVo() {
//        return tTenantVo;
//    }

//    public void settTenantVo(List<TTenant> tTenantVo) {
//        this.tTenantVo = tTenantVo;
//    }

    public void setMenusVo(List<SysMenu> menusVo) {
        this.menusVo = menusVo;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getCreatoraccountid() {
        return creatoraccountid;
    }

    public void setCreatoraccountid(Long creatoraccountid) {
        this.creatoraccountid = creatoraccountid;
    }

    public String getAvatar() {
        return avatar;
    }

    public String getLoginUser() {
        return loginUser;
    }

    public void setLoginUser(String loginUser) {
        this.loginUser = loginUser;
    }

    public String getSubno() {
        return subno;
    }

    public void setSubno(String subno) {
        this.subno = subno;
    }
}